<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/admin.css" media="all">
		<style type="text/css">
			/* tooltip */
			#tooltip {
				position: absolute;
				border: 1px solid #ccc;
				background: #333;
				padding: 2px;
				display: none;
				color: #fff;
			}
		</style>
	</head>

	<body style="padding:10px;">
		<div class="tplay-body-div">
			<div class="layui-tab">
				<ul class="layui-tab-title">
					<li class="layui-this">房间分类</li>
					<li>
						<a href="{:url('admin/house/add_room')}" class="a_menu">新增分类</a>
					</li>
				</ul>
			</div>
			<form class="layui-form serch" action="{:url('admin/house/room_type')}" method="post">
				<div class="layui-form-item" style="float: left;">
					<div class="layui-input-inline">
						<div class="layui-inline">
							<select name="store_id" lay-search="">
								<option value="">请选择门店</option>
								{volist name="$info.store" id="vo"}
								<option value="{$vo.id}">{$vo.store_name}</option>
								{/volist}
							</select>
						</div>
					</div>
					<div class="layui-input-inline">
						<input type="text" name="room_name" lay-verify="title" autocomplete="off" placeholder="请输入分类名称" class="layui-input layui-btn-sm">
					</div>
					<button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">查询</button>
				</div>
			</form>
			<table class="layui-table" lay-size="sm">
				<colgroup>
					<col width="50">
					<col width="80">
					<col width="100">
					<col width="150">
					<col width="150">
					<col width="200">
					<col width="200">
					<col width="200">
					<col width="100">
				</colgroup>
				<thead>
					<tr>
						<th>分类名称</th>
						<th>房间分类图片</th>
						<th>排序</th>
						<th>所属门店</th>
						<th>房间数量</th>
						<th>售价</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="room" id="vo"}
					<tr>
						<td>{$vo.room_name}</td>
						<td><img src="{$vo.room_img|geturl}" width="20" height="20"></td>
						<td>{$vo.show_dec}</td>
						<td>{$vo.store_name}</td>
						<td>{$vo.room_num}</td>
						<td>{$vo.room_price}</td>
						<td class="operation-menu">
							<div class="layui-btn-group">
								<a href="{:url('admin/house/add_room',['id'=>$vo.id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
								<!--<a class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>-->
							</div>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			<div style="padding:0 20px;">{$room->render()}</div>

			{include file="public/foot"}

			<script type="text/javascript">
				$('.delete').click(function() {
					var id = $(this).attr('id');
					layer.confirm('确定要删除?', function(index) {
						$.ajax({
							url: "{:url('admin/house/room_delete')}",
							data: {
								id: id
							},
							success: function(res) {
								layer.msg(res.msg);
								if(res.code == 1) {
									setTimeout(function() {
										location.href = res.url;
									}, 1500)
								}
							}
						})
					})
				})
			</script>
		</div>
	</body>

</html>